﻿
 
 
 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		
		<title>jb-aptech毕业设计项目</TITLE>
<meta name="renderer" content="ie-comp">
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<link href="../../css/style.css" rel="stylesheet" type="text/css">
		<link rel="stylesheet" href="../../css/menu.css">

		<script src="../../script/jquery-3.3.1.min.js"></script>
		<script src="../../script/common.js"></script>
		<script src="../../../js/bootstrap.min.js"></script>
		<script src="../../../js/vue.js"></script>
	</head>
  <body>
  <div id="add">
   		<div class="page_title">
			权限管理 > 用户管理 > 系统角色管理 > 编辑角色
		</div>
			<div class="button_bar">
	   		<button class="common_button" onclick="help('');">帮助</button>
	   		<button class="common_button" onclick="back();">返回</button>
			<button class="common_button" @click="add()">保存</button>
	   	</div>
	   	<table class="query_form_table">
	   		<tr>
	   			<th>编号</th>
	   			<td>
	   				<input type="text" size="20"   readonly="readonly">
	   			</td>
	   			<th>角色名</th>
	   			<td>
	   				<input type="text" v-model="role.role_name"  size="20" >
					<span class="red_star" >*</span>
	   			</td>
	   		</tr>
	   		<tr>
	   			<th>角色描述</th>
	   			<td>
	   				<textarea  cols="20" v-model="role.role_desc" rows="3"></textarea>
	   			</td>
	   			<th>状态</th>
	   			<td>
	   				<select v-model="role.role_flag">
						<option value="1" selected>正常</option>
	   					<option value="2">禁用</option></select>
	   			</td>
	   		</tr>
	   	</table>
  </div>
  </body>

<script>
	var app = new Vue({
		el:'#add',
		data:{
			role:{
                role_name:'',
                role_desc:'',
                role_flag:1,
			}
		},
        methods:{
            add(){
                if(this.role.role_name==''||null){
                    alert("必填项存在空值！")
                    return
                }
                $.getJSON("/saveSysRole",app.role,function (json) {
					if(json.code==200){
						alert("新建角色成功！！！")
						location='list.html';
					}else {
					    alert("服务器异常");
					}
                });
			}
   		},
	});
</script>
</html>
